package com.cy.controller;

import com.cy.service.RemoteProviderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class FeignConController {
    @Autowired
    private RemoteProviderService remoteProviderService;

    /*执行远程服务调用
    * 访问：浏览器browser ---> 客户端consumer ---> 提供方provider
    * 1> brower
    * http://localhost:8090/consumer/echo/xxxxx
    * 2>consumer
    * http://sca-provider/provider/echo/xxxxx
    * */
    @GetMapping("/consumer/echo/{msg}")
    public String doRestEcho(String msg){
        return remoteProviderService.echoMsg(msg);
    }
}
